package com.mkaech.eece411;

import java.rmi.*;
import java.rmi.server.RemoteServer;

public class ChatServer
{		
	public static void main (String[] args)
	{
		ChatClientRegistry clientRegistry;
		RemoteServer.setLog(System.err); 
		
		try
		{
			clientRegistry = new ChatClientRegistry();
			Naming.rebind ("SChatClientRegistry", clientRegistry);
			System.out.println ("ChatServer is ready.");
		}
		catch (Exception e)
		{
			System.out.println ("ChatServer failed: " + e.getMessage());
			return;
    	}
		
		// wait forever
		while(true)
		{
			try
			{
				Thread.sleep(100);
			}
			catch(Exception e)
			{
				System.out.println("Server Error: " + e);
			}
		}

	}
}